﻿@model IEnumerable<SimpleCMS.Models.News>

@{
    ViewBag.Title = "Search";
}

<h2>Search</h2>

<p>
    @Html.ActionLink("Create New", "Create")
    @using (Html.BeginForm("Search","News",FormMethod.Get))
    {
        <p>
            Genre: @Html.DropDownList("AllGenre", "All")
            Title: @Html.TextBox("filter")<br />
            <input type="submit" value="Search" />
        </p>
    }
</p>

<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Time)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Title)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Content)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.EditorID)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.ClickCount)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Status)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Tags)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Genre)
        </th>
        <th></th>
    </tr>

    @foreach (var item in Model)
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Time)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Content)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.EditorID)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ClickCount)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Tags)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Genre)
            </td>
            <td>
                @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
            @Html.ActionLink("Details", "Details", new { id = item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.ID })
            </td>
        </tr>
    }

</table>
